package sjms.behavior.command;

import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName:
 * @Description: 命定
 * @Author fcb
 * @Date 2020/6/6 16:29
 */
public class CommandInvoke {

    private List<Command> commandList = new ArrayList<>();

    public void setCommand(Command command){
        commandList.add(command);
    }

    public void execute(){
        for(Command command: commandList){
            command.execute();
        }
    }
}
